package org.ccay.upload;
import org.ccay.core.exception.ApplicationException;
import org.ccay.core.exception.ExceptionHandler;
import org.ccay.core.exception.IHttpCodeProvided;

public class UploadException extends ApplicationException implements IHttpCodeProvided {
	private static final long serialVersionUID = -25527699010801101L;

	public UploadException(String errorCode, Exception causeBy) {
		super(errorCode, causeBy, new Object[] { causeBy.getMessage() });
		if (causeBy != null) {
			ExceptionHandler.logException(causeBy);
		}
	}

	public UploadException(String errorCode) {
		super(errorCode);
	}

	public UploadException(String errorCode, String param) {
		super(errorCode, new Object[] { param });
	}

	public UploadException(String errorCode, Exception causeBy, String param) {
		super(errorCode, causeBy, new Object[] { param });
		if (causeBy != null) {
			ExceptionHandler.logException(causeBy);
		}
	}

	public int getHttpCode() {
		return 200;
	}
}
